home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / TIBCO / _install / install_unbundled next >
Text File  |  1996-02-29  |  2KB  |  113 lines

  1. #!/bin/sh  
  2. #
  3. #    Installation shell script for Catalyst CDware
  4. #
  5. #     Usage: install_unbundled -m<mountpoint> -p<productpath>
  6. #
  7. #    Created:     June 12, 1991
  8. #    Last Revised:     May 23, 1994
  9. #
  10. #    Use this installation script to install your product from Catalyst CDware
  11. #
  12. #
  13. #    For technical support, please call.
  14. #        +1 415 336.3742 (CDware SPARC) or +1 415 336.3941 (CDware x86)
  15. #
  16. #    get command line parameters
  17. #
  18.  
  19. # function for error exiting
  20.  
  21. end_it () {
  22. echo " "
  23.   echo "Hit return to end ... "
  24.   read answer
  25.  
  26. exit 0
  27. }
  28.  
  29. #    set PRODUCT_SIZE to the size of your product in kbytes     
  30.  
  31. PRODUCT_SIZE=4200
  32.  
  33. #
  34. #    get complete paths
  35. #
  36. #
  37. #    get location of installation directory 
  38. ##
  39. echo
  40. echo
  41. echo "The software must be installed by root and under subdirectory /opt"
  42. echo "Enter your root password when prompted"
  43. echo ""
  44. echo ""
  45. INSTALL_DIR=/opt
  46. #
  47. #    verify free disk space
  48. #
  49. echo    
  50. echo    "Verifying free disk space under /opt ..."
  51. FREE_SPACE=0
  52. df=/tmp/FREE.$$
  53. #
  54. # WARNING:
  55. # --------
  56. # For Solaris 2.4, the df line below will need to be updated because
  57. # the standard output of the df command has changed in Solaris 2.4
  58. #
  59. /usr/bin/df -k $INSTALL_DIR | sed /kbytes/d | sed -e '3,$d' | sed -e '1,$s/  */ /g' > $df
  60.  
  61. case `/usr/bin/wc -l $df | sed -e 's/^ *//' | cut -f1 -d" " ` in
  62.     1) FREE_SPACE=`cat $df | cut -f4 -d" "` ;; 
  63.     2) FREE_SPACE=`cat $df | sed 1d | sed 's/^ *//' | cut -f3 -d" "` ;; 
  64. esac
  65.  
  66. if [ -n $FREE_SPACE ]
  67. then
  68.     if [ $FREE_SPACE -lt $PRODUCT_SIZE ]
  69.     then
  70.         echo
  71.         echo
  72.         echo "The product installation requires $PRODUCT_SIZE kbytes of"
  73.         echo "free disk space. There is only $FREE_SPACE kbytes of free" 
  74.         echo "disk space in the selected filesystem.  Please free up some"
  75.         echo "disk space and try this installation again."
  76.         echo
  77.         echo "Exiting the installation script."
  78.             end_it     
  79.     fi
  80. fi
  81. /bin/rm $df 2>/dev/null
  82.  
  83. #
  84. # Get user id
  85. #
  86. if [ -f /usr/ucb/whoami ]
  87. then
  88.   USER=`/usr/ucb/whoami` ; export USER
  89. else
  90.   echo " "
  91.   echo "Cannot find /usr/ucb/whoami"
  92.   echo " "
  93.   end_it
  94. fi
  95.  
  96.  
  97. #
  98. # Check if root
  99. #
  100. if [ "$USER" = "root" ]; then
  101.     cd /opt
  102.     zcat $COMPANY_DIR/_install/ship_1.1.tar.Z | tar xvf -
  103.     cd ship_1.1;pkgadd -d .
  104. else
  105.     echo ""
  106.     echo " You must be SU to install software.  Please enter password."
  107.     echo ""
  108.     su root -c 'cd /opt;zcat $COMPANY_DIR/_install/ship_1.1.tar.Z | tar xvf -;cd ship_1.1;pkgadd -d .'
  109.  
  110. fi
  111.  
  112. end_it
  113.